<template>
    <div class="filter-box">
        <div class="filter-top">
            <div class="tip">筛选</div>
            <div class="btn btnPointer">确定</div>
        </div>
        <div class="select-box">
            <!-- 年份 -->
            <el-select popper-class="customClass" v-model="localSelect.year" placeholder="年度" class="select1 base-select" @change="onYear" clearable>
                <el-option v-for="item in yearColumns" :key="item.value" :label="item.label" :value="item.value" />
            </el-select>
            <el-select popper-class="customClass" v-model="localSelect.all" placeholder="全部" class="select1 base-select" clearable>
                <el-option v-for="item in yearColumns" :key="item.value" :label="item.label" :value="item.value" />
            </el-select>
            <el-select popper-class="customClass" v-model="localSelect.depart" placeholder="科室" class="select2 base-select" clearable>
                <el-option v-for="item in yearColumns" :key="item.value" :label="item.label" :value="item.value" />
            </el-select>
            <el-select popper-class="customClass" v-model="localSelect.leader" placeholder="分管领导" class="select1 base-select" clearable>
                <el-option v-for="item in yearColumns" :key="item.value" :label="item.label" :value="item.value" />
            </el-select>
            <el-select popper-class="customClass" v-model="localSelect.process" placeholder="进度状态" class="select1 base-select" clearable>
                <el-option v-for="item in yearColumns" :key="item.value" :label="item.label" :value="item.value" />
            </el-select>
            <el-select popper-class="customClass" v-model="localSelect.taskType" placeholder="任务类别" class="select2 base-select" clearable>
                <el-option v-for="item in yearColumns" :key="item.value" :label="item.label" :value="item.value" />
            </el-select>
        </div>
    </div>


</template>

<script setup>
const props = defineProps({
    selectValue:{
        type:Object
    }
})

const localSelect = computed({
    get() {
        return props.selectValue
    },
    set(value) {
        emit('update:selectValue', value)
    }
})

//年
const yearColumns = ref([])
function createYearColumn() {
    const currentYear = new Date().getFullYear(); // 获取当前年份
    for (let i = -2; i <= 0; i++) {
        const year = currentYear + i; // 计算当前年及之前两年
        yearColumns.value.push({ label: year.toString(), value: year.toString() });
    }
    // yearColumns.value.push({ label: '技术部门23123', value: 123})
}
function onYear(value) {
}

onMounted(() => {
    createYearColumn()
})



</script>
<style>
.el-select__selected-item {
    top: 0;
    line-height: 30px;
}
.el-select__suffix > .el-icon {
    font-size: 22px;
}

</style>
<style lang="scss" scoped>
.filter-box {
    padding: 14px 26px 30px 26px;
    box-sizing: border-box;
    // height: 296px;
    opacity: 1;
    border-radius: 30px 30px 0px 0px;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0px 8px 10px 4px rgba(218, 231, 245, 0.5);

    .filter-top {
        display: flex;
        align-items: center;
        justify-content: space-between;

        .tip {
            font-size: 28px;
            color: rgba(51, 51, 51, 1);
        }

        .btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 106px;
            height: 60px;
            font-size: 26px;
            color: rgba(255, 255, 255, 1);
            border-radius: 50px;
            background: linear-gradient(160.78deg, rgba(0, 160, 252, 1) 0%, rgba(8, 173, 255, 1) 100%), linear-gradient(90deg, rgba(47, 135, 229, 1) 0%, rgba(97, 184, 246, 1) 100%);
        }
    }
}

.base-select {
    width: auto;
    margin-top: 10px;
}

// .select1 {
//     flex: 1;
// }
// .select2 {
//     flex: 1.2;
// }

::v-deep(.select1 .el-select__wrapper) {
    font-size: 28px;
    min-width: 190px;
    height: 76px;
    border-radius: 20px;
    background: rgba(248, 248, 250, 1);
    border: none;
    box-shadow: none;
}

::v-deep(.select2 .el-select__wrapper) {
    font-size: 28px;
    min-width: 270px;
    height: 76px;
    border-radius: 20px;
    background: rgba(248, 248, 250, 1);
    border: none;
    box-shadow: none;
}
// ::v-deep(.el-select__wrapper >.el-select__placeholder) {
//     top: 0;
//     color: red;
// }
.select-box {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}
::v-depp(.el-select__suffix > .el-icon) {
    font-size: 20px;
}
.customClass {
    .el-select-dropdown__item {
        font-size: 28px;
        height:56px;
        line-height: 56px;
    }

}

</style>